package com.cje;/**
 * @Auther: ChenJinEn
 * @Date: 2020/8/13 10:39
 * @Description: //TODO
 */

import com.cje.singleton.demo.Demo1;
import com.cje.singleton.demo.Demo2;
import com.cje.singleton.demo.Demo3;

import java.io.*;

/**
 *@ClassName Test
 *@Description TODO
 *@Author checkZH
 *@Date 2020/8/13 10:39
 *@Version 1.0
 */
public class Test  {

    public static void main(String[] args) throws Exception {
        Demo1 demo2 = Demo1.getSingleObj();
        System.out.println(demo2.hashCode());
        Demo1 demo3 = Demo1.getSingleObj();
        System.out.println(demo3.hashCode());
        ObjectOutputStream obji = new ObjectOutputStream(new FileOutputStream("Object1.txt"));
        obji.writeObject(demo2);
        ObjectInputStream Obji1 = new ObjectInputStream(new FileInputStream("Object1.txt"));
        Demo1 test1 = (Demo1) Obji1.readObject();
        System.out.println(test1.hashCode());
    }
}
